package com.myprojects.common.pojo;

import javax.validation.constraints.Pattern;
import java.util.List;

public class Role {
    private Integer id;

    @Pattern(regexp = "^([^\"]){3,10}$",
            message = "角色名必须为3-10的任意字符!")
    private String role_name;

    @Pattern(regexp = "^([^\"]){0,100}$",
            message = "简介不能超过100个字符!")
    private String brief;

    private List<Resource> resourceList;

    private List<Integer> resourceIdList;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getRole_name() {
        return role_name;
    }

    public void setRole_name(String role_name) {
        this.role_name = role_name == null ? null : role_name.trim();
    }

    public String getBrief() {
        return brief;
    }

    public void setBrief(String brief) {
        this.brief = brief == null ? null : brief.trim();
    }

    public List<Resource> getResourceList() {
        return resourceList;
    }

    public void setResourceList(List<Resource> resourceList) {
        this.resourceList = resourceList;
    }

    public List<Integer> getResourceIdList() {
        return resourceIdList;
    }

    public void setResourceIdList(List<Integer> resourceIdList) {
        this.resourceIdList = resourceIdList;
    }

    @Override
    public String toString() {
        return "Role{" +
                "id=" + id +
                ", role_name='" + role_name + '\'' +
                ", brief='" + brief + '\'' +
                ", resourceList=" + resourceList +
                ", resourceIdList=" + resourceIdList +
                '}';
    }
}